package com.leather.admin.feignclient;

import com.leather.admin.config.FeignConfig;
import com.leather.admin.feignclient.impl.UserClientHystrix;
import com.leather.common.result.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "campus-user", configuration = FeignConfig.class, fallback = UserClientHystrix.class)
public interface UserClient {


    @PostMapping("/frozenuser")
    Result frozenUser(@RequestParam("userId") int userId);

    @PostMapping("/unfrozenuser")
    Result unFrozenUser(@RequestParam("userId") int userId);

    @GetMapping("/list")
    Object list(
            @RequestParam(value = "offset", required = false, defaultValue = "0") int offset,
            @RequestParam(value = "limit", required = false, defaultValue = "10") int limit,
            @RequestParam(value = "order", required = false, defaultValue = "asc") String order,
            @RequestParam(value = "search", required = false, defaultValue = "") String search
    );

}
